jQuery(function($) {
	$('.nav').flynav({
		onLoad: function(page) {
			var wrap = $(this);
			wrap.niceScroll({
				cursorcolor:"#FFF",
				cursorwidth:"10px",
				cursorborder: "",
				bouncescroll: true,
				cursoropacitymin: 0.5,
			});
			$('body>div:last').addClass('scrollbar');
			wrap.find('.subnav').flynav({
				autoTop: "(idx+1)*100+'%'"
			});
		},
		onBeforeHide: function() {
			console.log("BEFORE HIDE: " + $(this).find('h1').text());
			var page = $(this), article = page.find('.article');
			// page.animate({ val: 10 },{ step: function(now) {
			// 	article.css('text-shadow','0px 0px ' + Math.ceil(now) + 'px #000');
			// }});
		},
		onBeforeShow: function() {
			console.log("BEFORE SHOW: " + $(this).find('h1').text());
			var page = $(this), article = page.find('.article');
			// page.animate({ val: 10 },{ step: function(now) {
			// 	console.log('0px 0px ' + Math.ceil(10 - now) + 'px #000');
			// 	article.css('text-shadow','0px 0px ' + Math.ceil(10 - now) + 'px #000');
			// }});
		},
		onHide: function() {
			console.log("HIDE: " + $(this).find('h1').text());
		},
		onShow: function() {
			console.log("SHOW: " + $(this).find('h1').text());
		}
		// positions: {
		// 	'index.html': { top: 0, left: 0, rotate: 0, scale: 1 },
		// 	'page1.html': { top: 500, left: 100, rotate: 20, scale: 0.2 },
		// 	'page2.html': { top: 450, left: 250, rotate: -30, scale: 0.2 },
		// 	'page3.html': { top: 500, left: 450, rotate: 40, scale: 0.2 },
		// 	'page4.html': { top: 450, left: 550, rotate: -10, scale: 0.2 },
		// 	'page5.html': { top: 450, left: 880, rotate: 90, scale: 0.2 },
		// }
	});
});
